<%--
  Created by IntelliJ IDEA.
  User: 王鹏欢
  Date: 2022-03-14
  Time: 15:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>Title</title>
    </head>
    <body>
        <%
        request.setCharacterEncoding("UTF-8");
                response.setCharacterEncoding("UTF-8");

            String username = request.getParameter("username");
            String password = request.getParameter("password");
            String confpassword = request.getParameter("confpassword");
            String email = request.getParameter("email");

            //out.println("userName"+username+"<br/>");
            //out.println("password"+password);
            //out.println("confpassword"+confpassword);
            //out.println("email"+email);
        %>

        <%=username%> <br>
        <%=password%><br>
        <%=confpassword%><br>
        <%=email%><br>


        <%
            if (username != null&&"admin".equals(username)) {
                request.getRequestDispatcher("index.jsp").forward(request,response);
            }else {
                String errMsg="输入用户名"+username+"不合法";
                session.setAttribute("errMsg",errMsg);
                session.setAttribute("username",username);
                response.sendRedirect("register.jsp");
            }
        %>
    </body>
</html>
